package Demo;


import java.io.*;
import java.util.Arrays;

public class work {
    public static void main(String[] args) {
        File ab = new File("io", "ab");
        File file =  new File("e:\\io\\ab\\b\\b");
        File file2 = new File("io/ab/a/a.txt");
        System.out.println(ab.getAbsolutePath());
        System.out.println(ab.getName()+"||"+ab.mkdir());
        System.out.println(file.getName());
        System.out.println(file.getParent());
        System.out.println(file.getParentFile().getParentFile().getName());
        File[] files = file.getParentFile().getParentFile().listFiles();
        System.out.println(files);

        if (ab.isDirectory()) {
            String[] filenames = file.list();
            Arrays.stream(filenames).forEach(f -> System.out.println(f));
        }
    }
}
